package myJs.myPkg

import myJs.Implicits.JDJAn
import slinky.core._
import slinky.core.annotations.react
import slinky.core.facade.ReactElement
import slinky.readwrite.ObjectOrWritten

import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport

/**
 * Created by yz on 28/3/2022
 */

@react object Modal extends ExternalComponent {
  case class Props(
                    onHide: js.UndefOr[() => Unit] = js.undefined,
                    show: js.UndefOr[Boolean] = js.undefined,
                    bsClass: js.UndefOr[String] = js.undefined,
                    dialogComponentClass: js.UndefOr[String] = js.undefined,
                    backdropClassName: js.UndefOr[String] = js.undefined,
                    dialogClassName: js.UndefOr[String] = js.undefined,
                  )

  @js.native
  @JSImport("react-bootstrap", "Modal")
  object Component extends js.Object {

    val Dialog: js.Object = js.native

    val Header: js.Object = js.native

    val Title: js.Object = js.native

    val Body: js.Object = js.native

    val Footer: js.Object = js.native

  }

  override val component = Component

  @react object Dialog extends ExternalComponent {
    case class Props(
                      dialogClassName: js.UndefOr[String] = js.undefined
                    )

    override val component = Component.Dialog

  }

  @react object Header extends ExternalComponent {
    case class Props(
                      bsPrefix: js.UndefOr[String] = js.undefined,
                      closeButton: js.UndefOr[Boolean] = js.undefined
                    )

    override val component = Component.Header

  }

  @react object Title extends ExternalComponent {
    case class Props()

    override val component = Component.Title

  }

  @react object Body extends ExternalComponent {
    case class Props()

    override val component = Component.Body

  }

  @react object Footer extends ExternalComponent {
    case class Props(
                      bsPrefix :js.UndefOr[String]=js.undefined
                    )

    override val component = Component.Footer

  }


}
